package com.sc.nft.dao;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.entity.ShareProfit;
import com.sc.nft.enums.DivideTypeEnum;
import com.sc.nft.mapper.ShareProfitMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * (sc_collection_share_profit)数据DAO
 *
 * @author zxy
 * @since 2023-12-06 16:05:42
 * @description 商户banner
 */
@Slf4j
@Repository
public class ShareProfitDao extends ServiceImpl<ShareProfitMapper, ShareProfit> {


    public void clearByPanelId(Long panelId){
        lambdaUpdate().eq(ShareProfit::getPanelId,panelId).remove();
    }

    public List<ShareProfit>  getByPanelId(Long panelId){
        return lambdaQuery().eq(ShareProfit::getPanelId,panelId).list();
    }
    public List<ShareProfit>  getByPanelIdAndType(Long panelId, DivideTypeEnum divideType){
        return lambdaQuery().eq(ShareProfit::getPanelId,panelId).eq(ShareProfit::getDivideType,divideType).list();
    }
}